import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';

export const querySchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    fieldName: 'operateName',
    label: '菜单名称',
  },
  {
    component: 'Input',
    fieldName: 'nickName',
    label: '操作人',
  },
  {
    component: 'RangePicker',
    fieldName: 'operateTime',
    label: '操作时间',
  },
];

export const columns: VxeGridProps['columns'] = [
  {
    title: '操作人昵称',
    field: 'nickName',
    width: 120,
  },
  {
    title: '菜单名称',
    field: 'operateName',
    width: 140,
  },
  {
    title: '请求参数',
    field: 'operateParam',
  },
  {
    title: '返回值',
    field: 'operateResult',
  },
  {
    title: '请求耗时(ms)',
    field: 'requestDuration',
    width: 120,
  },
  {
    title: '创建时间',
    field: 'gmtCreated',
    width: 150,
  },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    resizable: false,
    width: 'auto',
  },
];
